{
  "properties" : { },
  "id" : "f7915c1108c54eaa8ff9af171457d38b",
  "script" : null,
  "groupId" : "b6112dd1a5fc4f9f98d1a3435a834c9b",
  "name" : "查询角色",
  "createTime" : 1718810325672,
  "updateTime" : 1712229827930,
  "lock" : null,
  "createBy" : "管理员",
  "updateBy" : "管理员",
  "path" : "list",
  "method" : "GET",
  "parameters" : [ {
    "name" : "roleName",
    "value" : null,
    "description" : null,
    "required" : false,
    "dataType" : "String",
    "type" : null,
    "defaultValue" : null,
    "validateType" : null,
    "error" : null,
    "expression" : null,
    "children" : null
  }, {
    "name" : "roleCode",
    "value" : null,
    "description" : null,
    "required" : false,
    "dataType" : "String",
    "type" : null,
    "defaultValue" : null,
    "validateType" : null,
    "error" : null,
    "expression" : null,
    "children" : null
  }, {
    "name" : "current",
    "value" : "1",
    "description" : null,
    "required" : false,
    "dataType" : "Integer",
    "type" : null,
    "defaultValue" : "1",
    "validateType" : "expression",
    "error" : "跳转的页不存在",
    "expression" : "current > 0",
    "children" : null
  }, {
    "name" : "limit",
    "value" : "10",
    "description" : null,
    "required" : false,
    "dataType" : "Integer",
    "type" : null,
    "defaultValue" : "10",
    "validateType" : "expression",
    "error" : "每页大小过大",
    "expression" : "limit < 999",
    "children" : null
  } ],
  "options" : [ {
    "name" : "permission",
    "value" : "system:jsgl",
    "description" : "允许拥有该权限的访问",
    "required" : false,
    "dataType" : "String",
    "type" : null,
    "defaultValue" : null,
    "validateType" : null,
    "error" : null,
    "expression" : null,
    "children" : null
  } ],
  "requestBody" : "",
  "headers" : [ ],
  "paths" : [ ],
  "responseBody" : null,
  "description" : null,
  "requestBodyDefinition" : null,
  "responseBodyDefinition" : null
}
================================
import com.alibaba.fastjson.JSONObject;
import com.gitee.fastmybatis.core.query.Query;
import com.gitee.fastmybatis.core.query.Sort;

import 'com.wiwf.model.mapper.admin.dao.SysRoleMapper' as sysRoleMapper;

var query = new Query().page(current,limit);

if(roleName){
    query.like("role_name", roleName);
}
if(roleCode){
    query.like("role_code", roleCode);
}

if(orderProperty){
    query.orderby(orderProperty, orderSort? Sort.ASC: Sort.DESC);
}

return sysRoleMapper.page(query);